#!/usr/bin/env python
#-------------------------------------------------------------------------------
# Name:        tWebClient.py
# Purpose:     sample
#
# Author:      Lotte
#
# Created:     12/08/2012
# Copyright:   (c) Lotte 2012
# Licence:     <your licence>
#-------------------------------------------------------------------------------

import urllib
import httplib


def main():
    #print get_serial_name("abc.d",1)

    host = r'auspost.com.au'
    url = r'/track/track.html?id=UCL0003192'
    data = {} #urllib.urlencode({'@number': 12524, '@type': 'issue', '@action': 'show'})
    headers = {"Content-type": "application/x-www-form-urlencoded",
               "Accept": "text/plain"}
    conn = httplib.HTTPConnection(host)
    conn.request('GET', url, headers)
    httpres = conn.getresponse()
    print httpres.status
    print httpres.reason
    print httpres.read()


if __name__ == '__main__':
    main()
